package com.zaofan.service;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zaofan.bean.PackageOrderInfo;
import com.zaofan.dao.PackageOrderInfoDao;

public class PackageOrderInfoService {
	private PackageOrderInfoDao packageOrderInfoDao = new PackageOrderInfoDao();

	public void delete(PackageOrderInfo packageOrderInfo) {
		packageOrderInfoDao.del(packageOrderInfo);
	}

	public void add(PackageOrderInfo packageOrderInfo) {
		packageOrderInfoDao.add(packageOrderInfo);
	}

	public void update(PackageOrderInfo packageOrderInfo) {
		packageOrderInfoDao.update(packageOrderInfo);
	}

	public List<PackageOrderInfo> findAll(Map<String, Object> params) {
		List<PackageOrderInfo> data = packageOrderInfoDao.findAll(params);
		if (data == null) {
			data = new ArrayList<>();
		}
		return data;
	}

	public Long count(Map<String, Object> params) {
		return packageOrderInfoDao.count(params);
	}

	public PackageOrderInfo findById(Integer id) {
		Map<String, Object> params = new HashMap<>();
		params.put("id", id);
		return packageOrderInfoDao.findOne(params);
	}

	public PackageOrderInfo findByOrderNo(String out_trade_no) {
		Map<String, Object> params = new HashMap<>();
		params.put("orderNo", out_trade_no);
		return packageOrderInfoDao.findOne(params);
	}

}
